﻿using ShareCode.Dto;
using ShareCode.Dto.Corpus;
using ShareCode.Entity.Corpus;

namespace ClientDao.Corpus
{
    public class CorpusAdornDal : BaseContainTitleDal<CorpusAdornEntity>
    {
        public CorpusAdornDal()
        {
            Controller += "Corpus/CorpusAdorn";
        }

        public async Task<ResultDto<PagingWithDataModel<CorpusAdornWithTypeDto>>> ListPageWithTypeAsync(PagingDto SearchModel)
        {

            if (SearchModel == default)
            {
                SearchModel = new PagingDto();
            }

            var imgstream = await PostAsync<PagingDto, PagingWithDataModel<CorpusAdornWithTypeDto>>($"ListPageWithType", SearchModel);

            return imgstream;

        }
        public async Task<ResultDto<List<CorpusAdornWithTypeDto>>> ListWithTypeAsync(PagingDto SearchModel)
        {

            if (SearchModel == default)
            {
                SearchModel = new PagingDto();
            }

            var imgstream = await PostAsync<PagingDto, List<CorpusAdornWithTypeDto>>($"ListWithType", SearchModel);

            return imgstream;

        }
        public async Task<ResultDto<PagingWithDataModel<CorpusAdornWithTypeDto>>> ListPageWithTypeNoDeleteAsync(PagingDto SearchModel)
        {

            if (SearchModel == default)
            {
                SearchModel = new PagingDto();
            }

            var imgstream = await PostAsync<PagingDto, PagingWithDataModel<CorpusAdornWithTypeDto>>($"ListPageWithTypeNoDelete", SearchModel);

            return imgstream;

        }
        public async Task<ResultDto<List<CorpusAdornWithTypeDto>>> ListWithTypeNoDeleteAsync(PagingDto SearchModel)
        {

            if (SearchModel == default)
            {
                SearchModel = new PagingDto();
            }

            var imgstream = await PostAsync<PagingDto, List<CorpusAdornWithTypeDto>>($"ListWithTypeNoDelete", SearchModel);

            return imgstream;

        }
    }
}
